package com.qf.springmvc;

import com.qf.pojo.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;


@RequestMapping("/req")
//@Controller
//@ResponseBody//代表当前为方法都为响应正文
@RestController//Controller和ResponseBody的组合
public class ReqBodyController {
    @RequestMapping("/test1")
    public User test1(@RequestBody User user){
        user.setHobby(user.getHobby()+"--------->二比五");
        return user;
    }
}
